package co.yixiang.business.post

import co.yixiang.business.comment.CommentVo
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.time.LocalDateTime


@ApiModel("帖子查询条件")
data class PostDto(

    @ApiModelProperty("搜索条件0: 全部 1.关注 2.同城 3.我的") var type: Int? = 0,
    @ApiModelProperty("经度") var longitude: String? = "",
    @ApiModelProperty("维度") var latitude: String? = "",
    @ApiModelProperty("发布内容") var content: String? = "",
    @ApiModelProperty("页数") var pageNum: Int? = 10,
    @ApiModelProperty("每页大小") var pageSize: Int? = 1,
    @ApiModelProperty("当前用户id") var userId: Long? = null
)


@ApiModel("帖子列表返回实体")
data class PostVo(

    @ApiModelProperty("用户信息") var userInfo: UserInfo? = null,
    @ApiModelProperty("最新回复时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var lastCommentTime: LocalDateTime? = null,
    @ApiModelProperty("帖子id") var postId: Long? = null,
    @ApiModelProperty("发布内容") var content: String? = "",
    @ApiModelProperty("发布图片") var pics: List<String>? = null,
    @ApiModelProperty("经度") var longitude: String? = "",
    @ApiModelProperty("维度") var latitude: String? = "",
    @ApiModelProperty("距离") var distance: String? = "",
    @ApiModelProperty("评论数") var commentCount: Int? = 0,
    @ApiModelProperty("点赞数") var likeCount: Int? = 0,
    @ApiModelProperty("评论回复实体") var commentVos: List<CommentVo>? = null,
    @ApiModelProperty("发布时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") var createTime: LocalDateTime? = null
)

@ApiModel("用户信息")
data class UserInfo(

    @ApiModelProperty("用户id") var userId: Long? = null,
    @ApiModelProperty("用户头像") var avatar: String? = "",
    @ApiModelProperty("真实姓名") var realName: String? = "",
    @ApiModelProperty("年龄") var age: Int? = 0,
    @ApiModelProperty("性别") var sex: Int? = 0,
)
